home *** CD-ROM | disk | FTP | other *** search
- Hi guys,
-
- I promised this text several moons ago but I've been a little busy so
- I couldn't bring it to you. I've read some of you are in the good way to
- get it, hope this helps.
-
-
- It's an excerpt from the sources of this part.
- The sources of this part and probably the Rubber Polygons will be
- released as soon as I get them, probably next week.
- (If someone is so nice to tell me the procedure do upload something at
- ftp.eng.ufl.edu I'll be eternally grateful as I've never done it before).
-
- Well, here it goes.
-
- ===8<=====================================================
- ; // UpdateTable : performs one integration step on U[CT] // ARM 12/93
-
- ; Differential equation is: u = a▓( u + u )
- ; tt xx yy
- ;
- ; Where a▓ = tension * gravity / surface_density.
- ;
- ; Aproximating second derivatives by central differences:
- ;
- ; [ u(t+1)-2u(t)+u(t-1) ] / ït▓ = a▓ (u(x+1)+u(x-1)+u(y+1)+u(y-1)-4u) / h▓
- ;
- ; (where ït = time step, h=ïx=ïy = mesh resolution
- ;
- ; From where u(t+1) may be calculated as:
- ; ⌡ 1 └
- ; u(t+1) = a▓ït▓/h▓ ■ 1 0 1 ■u - u(t-1) + (2-4a▓ït▓/h▓)u
- ; ┴ 1 π
- ;
- ; When a▓ït▓/h▓ = ╜ last term vanishes, giving:
- ; ⌡ 1 └
- ; u(t+1) = ╜ ■ 1 0 1 ■u - u(t-1)
- ; ┴ 1 π
- ;
- ; This needs only 4 ADD/SUB and one SAR operation per mesh point!
- ;
- ; (note that u(t-1,x,y) is only used to calculate u(t+1,x,y) so
- ; we can use the same array for both t-1 and t+1, needing only
- ; two arrays, U[0] and U[1])
- ;
- ; Dampening is simulated by subtracting 1/2^n of result.
- ; n=4 gives best-looking result
- ; n<4 (eg 2 or 3) thicker consistency, waves die out immediately
-
- ; n>4 (eg 8 or 12) more fluid, waves die out slowly
-
- ;
- ===8<=====================================================
-
- Po' si son torpes ;-), explica que
-
- ⌡ 1 └
- ■ 1 0 1 ■u 1*u(x-1,y)+0*u(x,y)+1*u(x+1,y)
- ┴ 1 π
- +1*u(x,y+1)+1*u(x,y-1)
-
- osa, que queda:
-
- u[1,x,y] = (u[0,x-1,y]+u[0,x+1,y]+u[0,x,y-1]+u[0,x,y+1])/2 - u[1,x,y]
-
- intercambiando los papeles de u[0] y u[1] despues de cada paso, claro.
-
- >----------------------------------------------------------------------
-
-
- --
- Saludos Cesar.
-
- mtl93023@oasis.dit.upm.es/*iGUANA
- 2:341/27.37@fidonet.eur Pacific Point. Nada de Nada.
-
-
-
-